package everydayone.maxDepthAfterSplit;
/**
 * @Date 2020/04/1
 * @author 王光浩
 * @Thinking 使用双指针方法
 */
public class MyMethodTwo {
	public int[] maxDepthAfterSplit(String seq) {
		int[] ret=new int[seq.length()];
		if(seq.length()==0)return ret;
		ret[0]=0;
		for(int i=1;i<seq.length();i++) {
			if(seq.charAt(i)==seq.charAt(i-1))ret[i]=((ret[i-1]+1)%2);
			else ret[i]=ret[i-1];
		}
		return ret;
    }
}
